package com.ruoyi.project.search.viewInjobHistory.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.search.viewInjobHistory.mapper.ViewInJobHistoryMapper;
import com.ruoyi.project.search.viewInjobHistory.domain.ViewInJobHistory;
import com.ruoyi.project.search.viewInjobHistory.service.IViewInJobHistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 入库流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-29
 */
@Service
public class ViewInJobHistoryServiceImpl implements IViewInJobHistoryService 
{
    @Autowired
    private ViewInJobHistoryMapper viewInJobHistoryMapper;

    /**
     * 查询入库流水
     * 
     * @param jobDetailId 入库流水主键
     * @return 入库流水
     */
    @Override
    public ViewInJobHistory selectViewInJobHistoryByJobDetailId(String jobDetailId)
    {
        return viewInJobHistoryMapper.selectViewInJobHistoryByJobDetailId(jobDetailId);
    }

    /**
     * 查询入库流水列表
     * 
     * @param viewInJobHistory 入库流水
     * @return 入库流水
     */
    @Override
    public List<ViewInJobHistory> selectViewInJobHistoryList(ViewInJobHistory viewInJobHistory)
    {
        return viewInJobHistoryMapper.selectViewInJobHistoryList(viewInJobHistory);
    }

    /**
     * 新增入库流水
     * 
     * @param viewInJobHistory 入库流水
     * @return 结果
     */
    @Override
    public int insertViewInJobHistory(ViewInJobHistory viewInJobHistory)
    {
        viewInJobHistory.setCreateTime(DateUtils.getNowDate());
        return viewInJobHistoryMapper.insertViewInJobHistory(viewInJobHistory);
    }

    /**
     * 修改入库流水
     * 
     * @param viewInJobHistory 入库流水
     * @return 结果
     */
    @Override
    public int updateViewInJobHistory(ViewInJobHistory viewInJobHistory)
    {
        return viewInJobHistoryMapper.updateViewInJobHistory(viewInJobHistory);
    }

    /**
     * 批量删除入库流水
     * 
     * @param jobDetailIds 需要删除的入库流水主键
     * @return 结果
     */
    @Override
    public int deleteViewInJobHistoryByJobDetailIds(String jobDetailIds)
    {
        return viewInJobHistoryMapper.deleteViewInJobHistoryByJobDetailIds(Convert.toStrArray(jobDetailIds));
    }

    /**
     * 删除入库流水信息
     * 
     * @param jobDetailId 入库流水主键
     * @return 结果
     */
    @Override
    public int deleteViewInJobHistoryByJobDetailId(String jobDetailId)
    {
        return viewInJobHistoryMapper.deleteViewInJobHistoryByJobDetailId(jobDetailId);
    }
}
